SK Configuration for OpenCPN

There are many different servers which can provide Signal K data. The first sections of this document explain the installation of Signal K node server for node.js, an implementation of Signal K server available on multiple platforms.

Note: this page has received appropriate updates for the v5.2 version of OpenCPN. It provides a support for Signal K data format as input data. The steps describing NMEA-0183 data generation from Signal K node server have been retained since that function is remains interesting.


External references


Additional Information

In this section, some practical configuration guide are collected for


Configuration use case of Signal K node server on Windows, native node.js installation

  1. Use your Windows search to find 'cmd' the command line terminal. Start signalk-server. This will create .signalk directory in you r home directory (keep it in mind, you will need it later, in more advanced operations) and an empty settings file in it.
    live.staticflickr.com_65535_49124148656_11d4819d2e_w.jpg
  2. Launch your browser and point it to, using the address bar and typing http://localhost:3000 and press Enter. If you can keep the terminal visible, you would see how the server activates to serve the user GUI:
    live.staticflickr.com_65535_49124338022_432239e6f2.jpg
  3. The GUI of the Signal K node serve will appear:
    live.staticflickr.com_65535_49123653503_6a46dca2d6_n.jpg
  4. In the lower part of the GUI, you can observe the version of the software and the unique ID of your server:
    live.staticflickr.com_65535_49123653438_0958d4abb4.jpg
  5. Filling in the vessel data is not mandatory - it is the same information that you have in you AIS transceiver but depending where you GPS is coming from, you may consider to give here the values of the antenna location in relation to the boat.
    live.staticflickr.com_65535_49123653408_7338f547d8_z.jpg
  6. Hopefully, in today's world, it goes without saying that you should enable the security on this network accessed service!
    live.staticflickr.com_65535_49124337827_6228853253_n.jpg
  7. You will notice that after many major changes in the configuration like this, but also the change in the inputs or outputs require that the Signal K node server is restarted. During this configuration exercise we need to do it quite often - let's learn to do it now:
    live.staticflickr.com_65535_49123653278_e67b1fab09_n.jpg
  8. Unlike its Linux counterpart, the Signal K node server is not running in this Windows use case as system level service which would restart it automatically - we started it from the command line, so we need to restart it also from the command line. Go to the terminal and press Ctrl+C (Press key 'Ctrl', keep it down and then press key 'C'). You will asked “Terminate batch job (Y/N)?”. Yes.
    live.staticflickr.com_65535_49123653238_f85b70f0f2_w.jpg
  9. To restart the server, use the up- and down- arrow keys of your keyboard to scroll to the signalk-server command, press Enter.
    NOTE : if this is deemed to be an annoyance, there is another way. One can click the restart button on the GUI (see below, step 11). This will stop the server (since this is not a Windows service, it will not restart - the mechanism to restart a killed service exists only on Linux for now). Create a startup-script using the instructions which you can find from the installation page. Put the resulting skstart.bat file on your Desktop and you can start the service simply by clicking on the icon.
  10. You will notice that you need to login to the server for the first time but also after some timeout period which we will set below:
    live.staticflickr.com_65535_49124148911_0c9a95386b_m.jpg
  11. You will notice now new buttons in the right hand corner: (1) will stop the server in our case, not restart it (see above how to restart), (2) is either for login or logout.
    live.staticflickr.com_65535_49123653798_a4264f80cc_t.jpg
  12. The automatic logout timeout and other security parameters can be further adjusted if you so wish:
    live.staticflickr.com_65535_49123653718_d9b5290424_w.jpg
  13. Now it is time for some input! Signal K server has so far none, so let's add one. Click Connections, then Add.
    live.staticflickr.com_65535_49124148761_fffa358d42_n.jpg
  14. In this use case we have USB connection to feed all NMEA-0183 data from a multiplexer or other system into the computer. Before, we did ask OpenCPN to read it. Now we put the Signal K node server in between, it will read the data from the USB and become broadcaster of ths data on different network channels, one of which we connect to OpenCPN so that will get the stream as well. Let's start with the USB data input - COM 4 is the USB serial port number, Signal K node server recognizes it but if you have multiple sources you need to know which one is the right one:
  15. Actually, the Signal K node server is now ready. But ready to send only Signal K data, which is accepted by OpenCPN v5.2 onwards.
  16. But what if we want to stick to the NMEA-0183 data ?. Perhapsbecause of an older version of OpenCPN, or for some other reason we want Signal K node server to send also NMEA-0183 data. Signal K data needs to be converted back to NMEA-0183 data and sent to the network. You may think that this is a performance penalty, but it is not, it has been tested. Signal K node server is foreseen for the conversion by default, of course, and we have the following plug-ins installed:
    live.staticflickr.com_65535_49124697102_a0f4905e82_w.jpg
  17. Let's look at that Set System Time plug-in. If you are underway and without Internet connection and/or you do not have a local NTP/PTP or other time server available in your local network, this plug-in allows you to synchronize your system time with the GPS-time. In this use case we are moored, and with Internet (we are going to need it soon), so we leave this plugin inactive:
    live.staticflickr.com_65535_49124697077_c547437aed_w.jpg
  18. The configuration of the Convert Signal K to NMEA0183 plugin's configuration is self-explanatory. If you hesitate, select all sentences to be converted from Signal K data (do not enable logging, unless you really plan to read those voluminous logs for debugging):
    live.staticflickr.com_65535_49124511306_19be87e82e.jpg
  19. You may want to skip the next steps but I will not since I have also AIS transceiver and I saw above that's its AIVDO-sentences were no included in the NMEA-conversions. Now I need the Internet connection in order to be able to download a few more plug-ins from Appstore:
    live.staticflickr.com_65535_49124696997_e1f3a98678_w.jpg
  20. I will download and install by clicking the small cloud with a download arrow at the end of each line two more plug-ins, ais-forwarder and @signalk/udp-nmea-plugin (which we are going to, optionally, need later on):
    live.staticflickr.com_65535_49124696937_5c51e04805_z.jpg
    live.staticflickr.com_65535_49124696892_6434565545_z.jpg
  21. I configure the AIS data (NMEA0183) forwarder plug-in like depicted below. The port number is 12000 for no particular reason, just better, IMO, than the default one to remember:
    live.staticflickr.com_65535_49124627692_9e0b5169ff_z.jpg
  22. Time to turn ON your boat's instruments and RESTART the Signal K node server (see above the specific way to do it from the Windows command-line). After the restart you would notice the connection activity reports on the Dashboard, data is coming in and some output ports are opened, good!
    live.staticflickr.com_65535_49124440346_d0bacd8b23_z.jpg
  23. In OpenCPN, you would now disable the USB and activate the TCP data connection to read both the NMEA-0183 data and the AIS-data from the two ports they are sent into:
    live.staticflickr.com_65535_49124629152_d428752047.jpg
  24. Done, it is finished, you are all set! Please remember to backup our .signalk directory from your home directory for not to lose all the above configuration workQ
  25. If you are interested in simplified and efficient broadcast method, let's modify the above a little bit by activating the @signalk/udp-nmea-plugin. It is a powerful way to get the same data we prepared above to multiple devices in the same network using unidirectional UDP protocol - less secure but faster and with this data and with this speed there is no reason not to use it. This is how it is configured: it need to know your network address and end it up with .255 which is the network's broadcat address. If you do not put LF or CR limiter, it is just one, long stream of NMEA-0183 data which gets out, using a limiter can be useful when debugging NMEA-0183 data.
  26. In your OpenCPN installations (all of them) you can use this single connection instead of the two TCP connections above. The address can be the same that you gave as broadcastAddress above but it can be also 0.0.0.255 or 127.0.0.255 (of which the latter is more elegant, perhaps). Port number must always match he defined one, though:
    live.staticflickr.com_65535_49123945128_0e5dd37380_z.jpg

^UP^


Howto stream out a recorded NMEA-file

As you may have noticed if reading the external, referenced documentation, it is possible to start the Signal K node server with a pre-installed NMEA-0183 or NMEA-2000 recorded data streaming. In a similar manner, if you have a NMEA-file and you want to stream it back both in Signal K data format to your auxiliary devices and on NMEA-0183 format to OpenCPN, you can give the file to Signal K node server as an input “connection” - the input being the file streaming.

  1. Put the file in your (here Windows-) home folder, in .signalk directory. Below we use a .txt extension for our file, mynmea0183file.txt, but it has no meaning for Signal K node server, it is only for clarity for file operations:
    live.staticflickr.com_65535_49129140481_8e66b64033_w.jpg
  2. In Signal K node server's GUI, in Connections, Add a new connection. Select File Stream as Input Type and Data Type as NMEA-0183. File name is the file name, nothing else. Apply:
    live.staticflickr.com_65535_49129140411_b5e324a2d3.jpg
  3. You will see now the new connection (input source):
    live.staticflickr.com_65535_49129323602_cb708bce35.jpg
  4. But when you go to Dashboard, there is no data going out, reportedly. As indicated in the configuration section of this document, one needs to restart the Signal K node server after any change in the input connections. Let's do that:
    live.staticflickr.com_65535_49129140736_be1cac6bb6_w.jpg
  5. Here we support that we're on a Windows, on a native node.js installation. As you may remember from the above, there is no automatic restarting of the service Signal K node server like there is on Linux. That's not a bad thing, since it gives us an opportunity to take a look at the modified configuration file in the aforementioned directory which now contains our settings:
    live.staticflickr.com_65535_49129140651_48c7bf0210_w.jpg
  6. Start the now stopped Signal K node server - see above for the instructions how to manage the stopping and restarting from the command line.
  7. You can see from the Dashboard now that your file is streamed out to all relevant channels. What comes to NMEA-0183 data, in addition to Signal K data, please note that the default plug-in to convert the Signal K to NMEA-0183 must be activated and configured (see the previous document):
    live.staticflickr.com_65535_49128651538_9054cd1794_z.jpg
  8. Let's check on OpenCPN what we get:
    live.staticflickr.com_65535_49128651478_2b069df60e.jpg
  9. Rember: the connection (the file streaming) is permantely stored in you configuration file and will run at each restart, until you remove it or disable it. That also, it requires the Signal K node server restart.

^UP^


How to use a NMEA-simulator to stream NMEA-0183 and NMEA-2000 data

In this example we are using the excellent NMEA-0183 and NMEA-2000 NMEA-simulator from http://www.kave.fi/Apps/ - we are referring in this guide to 20.11.2019 version. Please do not hesitate to click also on the Donate (to our own T.L.) button! You should download and install the NMEA-Simulator, but also the Com0Com Null-modem emulator for this use case.

  1. This by no means a user guide to the NMEA-simulator, there is a user's guide with it and the interface is, while feature rich, self-explanatory - as soon as you undertand that the boat is not moving only if there is wind, you need to make turn also the propellers! (For me, un voileux, it was hard to accept at first :-) .) Please note in the status bar the two output channels, we are going to discuss those below:
    live.staticflickr.com_65535_49129446761_2b6678a7ba_z.jpg
  2. If you have successfully installed the Com0Com null-modem emulator, you should see it the Device Manager of Windows, it takes a few seconds to check that all the ports do appear and that there are no errors - it will save a bunch of (forum hanging) time for you!
    live.staticflickr.com_65535_49129446726_6bdbfda673_n.jpg
  3. You would set the NMEA-simulator to write NMEA-0183 data to emulator port COM29 - the output will appear in port COM30:
    live.staticflickr.com_65535_49128956748_7477bcc654_z.jpg
  4. For the NMEA-2000 data we write to the port CNCA0 - the output will appear in CNCB0 port:
    live.staticflickr.com_65535_49129629927_25111c869b_z.jpg
  5. We will take a look now at my Signal K node server configuration (on a native Windows node.js installation) - you can see how the NMEA-2000 input stream is configured, coming from CNCB0 port as Actisense NGT-1 stream:
    live.staticflickr.com_65535_49129446901_e82fc5e258_z.jpg
  6. The NMEA-0183 input stream configuration:
    live.staticflickr.com_65535_49129446826_3950422d9f_w.jpg
  7. Let's see the dual input source streamer in action. Here OpenCPN is receiving data GPS and other such data from the UDP broadcast channel of Signal K node server, while all the so called Signal K delta data (see the technical description page) is sent to port 8375, from which it is captured by DashT plug-in which distributes the NMEA-2000 data containing RPM, oil pressure and water temperature to relevant Dashboard instruments - you may notice the quite high input from the simulator and the corresponding throughput of about 130 - 150 data (double) messages parsed and send to subcribed instruments every second:
    live.staticflickr.com_65535_49129543421_dca8d3061c_z.jpg
  8. (Minor) caveat for Windows users with multiple displays: current (2019) versions of NMEA-simulator do memorize the last window position alright when you close it. But if you are in multiscreen configuration when you stop it and then start on a single screen, it happily go to the empty space outsise of your single screen. I have not found any other way to get it back (other than branching back that other screen) but by using Registry Editor (search for it with Windows search), then searching for HKEY_CURRENT_USER\Software\Kave\NMEA_Simulator\ to clear the memorized position by deleting the corresponding keys, then starting again.

^UP^


(end)